@extends('PShop::layout')
@push('styles')
    <link href="{{asset(config('view.plugin').'/layui/css/layui.css')}}" rel="stylesheet">
    <style type="text/css">
        .am-modal-bd{padding:30px 10px;}
        dt{font-weight: normal;}
        .am-checkbox{margin-top: 0;margin-bottom: 0;line-height: inherit;}
    </style>
@endpush
@section('content')
    <section class="wapper">
        <div class="base-w">
            <div class="">
                <ol class="am-breadcrumb am-margin-bottom-0 am-padding-top-sm am-padding-bottom-sm">
                    <li><a href="#">首页</a></li>
                    <li><a href="#">购物车</a></li>
                    <li class="am-active"><a href="#">订单详情</a></li>
                </ol>
            </div>
            <div class="">
                <div class="am-margin-bottom am-bg-white am-padding" id="address-box"
                     data-area-action = "{{route('f_Home_getArea')}}"
                     data-add-action = "{{route('f_Pc_Address_create')}}"
                     @if(isset($address))
                        data-edit-action = "{{route('f_Pc_Address_update',['addr_id'=>$address->id])}}"
                        data-default = "{{json_encode($address->toArray())}}"
                     @endif
                >
                </div>
                <form method="post" action="{{route('f_Pc_Order_createOrder',['zone'=>$zone])}}">
                    {{csrf_field()}}
                    {{-- 收货地址--}}
                    <input type="hidden" name="address" id="post_addr" value="{{$address->id?? ''}}">
                    @if(isset($cart_id))
                    <input type="hidden" name="cart_id" value="{{$cart_id??''}}">
                    @endif
                    <div class="am-scrollable-horizontal shopCar-list-data am-bg-white am-padding-left-sm am-padding-right-sm">
                        @include('PShop::goods.buy_info.goods_info')
                    </div>
                    <div class="am-padding-top am-g am-bg-white">
                        <div class="am-u-md-6 am-u-lg-6 am-padding-right-0">
                            <dl class="am-padding-top-sm am-padding-bottom-sm am-ubb">
                                <dt class="am-text-xs am-link-muted">备注：<em class="am-padding-left-sm am-icon-question-circle am-text-sm"  data-am-modal="{target: '#fapiao-info'}"></em></dt>
                                <dd>
                                    <div class="am-form-group am-inline-block am-u-md-12">
                                        <textarea name="remark" style="width: 100%;padding: 2px 10px;" rows="5"></textarea>
                                    </div>
                                </dd>
                            </dl>
                        </div>
                        <div class="am-u-md-3 am-u-lg-3 am-padding-0">&nbsp;&nbsp;</div>
                        <div class="am-u-md-3 am-u-lg-3 am-padding-left-0 am-text-right">
                            <dl class="am-padding-top-sm am-padding-bottom-sm am-ubb">
                                <dt>商品合计：<i class="am-margin-left-xl am-inline-block" style="width: 7rem;">￥{{$total}}元</i></dt>
                                <dd>运费：<i class="am-margin-left-xl am-inline-block" style="width: 7rem;">￥{{$post_cost}}元</i></dd>
                            </dl>
                            <dl class="am-padding-top-sm am-padding-bottom-sm">
                                <dt>应付总额：<i class="am-text-danger am-margin-left-xl am-inline-block" style="width: 7rem;">￥{{$total+$agent_cost}}元</i></dt>
                                <dd class="am-margin-top-xs"><input type="submit" class="am-btn am-btn-sm am-btn-danger am-radius" value="立即付款"></dd>
                            </dl>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
    @include('PShop::order.address.address_list')
@endsection
@push('scripts')
    <script src="{{asset(config('view.plugin').'/layui/layui.js')}}"></script>
    <script src="{{asset(config('mall.pc_assets').'/js/buy.js')}}"></script>
    <script>
        $(function(){
            addressManager();
        });
    </script>
@endpush